


function validateForm(){
    var execute = "si"
    
    var message = "";
    if(iccid.value == ""){
        message = "Ingrese el Iccid" ;  
         $("#iccid").pulsate({
        color: "#E91313" ,
        repeat : true
       });
    }else if(movilName.value == ""){
        message = "Write the Movil";
         $("#movilName").pulsate({
        color: "#E91313" ,
        repeat : true
       });
    }else if(available.value != "0"){
        message = "El codigo ingresado no esta disponible";
         $("#iccid").pulsate({
        color: "#E91313" ,
        repeat : true
       });
    }else if(CboNetwork.value == ""){
        message = "Choose a Network"; 
    }else if(CboProvider.value == ""){
        message = "Choose a Provider"; 
    }else{ 
        document.getElementById("form").submit(); 
        return false ;
    }
    
    document.getElementById("bodyMessage").innerHTML = message; 
}

function confirmDelete(record){
    
    $('#id').val(record);  
}

function submitDelete(){
 
    document.getElementById("form").action = 'delete?id='+$('#id').val()+"&module="+$('#module').val();
    document.getElementById("form").submit();  
}

  function existIccid(){ 
      var execute = "si"; 
       if(iccid.value.length < 12){
           execute = "no";
           $('#showDetail').html('<input type="hidden" value="0" name="available" id="available" />'+
               '<span class="label label-important"><b>it requires a minimum 12 digits</b></span>   ');
       }
       
      contenedor = document.getElementById("iccidoriginal")  ;
      
    if(contenedor != null){
        
        if(iccidoriginal.value == iccid.value){ 
           
            execute = "no";
            $('#showDetail').html('<input type="hidden" value="0" name="available" id="available" />');
        }
    }
    if(execute == "si"){
    
        var requestUrl = '/GedeonMvc/mediationsimcard/searchByIccid'   ;
     
              $.ajax({
        type: "POST",
        url: requestUrl,
        data: "iccid="+iccid.value ,
        success: function(response){ 
        $('#showDetail').html(response);
        },
        error: function(e){
        alert('Error: ' + e);
        }
        });
}else if(execute == "no"){
    
    $("#iccid").pulsate({
                    color: "#E91313" ,
                    repeat: 2
                });
}

  
 
    }


